<?php 
class GalleryFloorWidget extends CWidget
{
    public $inputName ="img";
    public $id = '';
    public $gallery = array();

    public function init()
    {
        parent::init();
    }

    public function run()
    {
        $inputName = $this->inputName;
        $gallery = $this->gallery;
        $id = $this->id;
        if (empty($id)) {
            $id = rand(1000,9999);
        }
        $this->render("galleryfloor",compact('inputName','gallery','id'));
    }
}